define(['util','knockout'], function (Util,ko) {
    function ViewModel() {
        var scope = this;

        if(!scope.locationHash) scope.locationHash = Util.getLocationHash(2);
        if(!scope.skipOperations) scope.skipOperations = [];//skip operation for custom it in child card
        if(!scope.parentFieldName) scope.parentFieldName = 'fatherId';

        ko.root.menus.findSubItemsByParentField({value:scope.locationHash,name:'href',pName:scope.parentFieldName}).forEach(function (item) {
           if(scope.skipOperations.indexOf(item.name) == -1) {
               switch (item.name) {
                   case 'add':
                       scope.card.titleButtons.push(item);
                       break;
                   default:
                       scope.card.cardBody.params.operations.push(item);
               }
           }
        });
    }

    return ViewModel;
});
